
package com.cbwl.eoas.cms.model.sysconfig;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;


public class SysParamDTO extends CommonBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7543823165297280102L;
	
	private java.lang.Long id;
	private java.lang.String prmName;
	private java.lang.String prmEnumCode;
	private java.lang.String prmValue;
	private String prmRemark;
	private java.lang.String prmStatus;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	//columns END
	
	private String prmStatusName;
	
	private String param;
	
	

	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	
	public void setPrmName(java.lang.String value) {
		this.prmName = value;
	}
	
	public java.lang.String getPrmName() {
		return this.prmName;
	}
	
	public void setPrmEnumCode(java.lang.String value) {
		this.prmEnumCode = value;
	}
	
	public java.lang.String getPrmEnumCode() {
		return this.prmEnumCode;
	}
	
	public void setPrmValue(java.lang.String value) {
		this.prmValue = value;
	}
	
	public java.lang.String getPrmValue() {
		return this.prmValue;
	}
	
	public String getPrmRemark() {
		return prmRemark;
	}
	public void setPrmRemark(String prmRemark) {
		this.prmRemark = prmRemark;
	}

	public void setPrmStatus(java.lang.String value) {
		this.prmStatus = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.prmStatusName = redisValue;
			}
		}
	}
	
	public java.lang.String getPrmStatus() {
		return this.prmStatus;
	}
	
	public void setCreater(java.lang.Long value) {
		this.creater = value;
	}
	
	public java.lang.Long getCreater() {
		return this.creater;
	}
	
	public void setGmtCreate(java.util.Date value) {
		this.gmtCreate = value;
	}
	
	public java.util.Date getGmtCreate() {
		return this.gmtCreate;
	}
	
	public void setModifier(java.lang.Long value) {
		this.modifier = value;
	}
	
	public java.lang.Long getModifier() {
		return this.modifier;
	}
	
	public void setGmtModified(java.util.Date value) {
		this.gmtModified = value;
	}
	
	public java.util.Date getGmtModified() {
		return this.gmtModified;
	}
	
	public String getPrmStatusName() {
		return prmStatusName;
	}

	
	public void setPrmStatusName(String prmStatusName) {
		this.prmStatusName = prmStatusName;
	}
	
	public String getParam() {
		return param;
	}

	
	public void setParam(String param) {
		this.param = param;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("PrmName",getPrmName())
			.append("PrmEnumCode",getPrmEnumCode())
			.append("PrmValue",getPrmValue())
			.append("PrmRemark",getPrmRemark())
			.append("PrmStatus",getPrmStatus())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SysParamDTO == false){return false;}
		if(this == obj){return true;}
		SysParamDTO other = (SysParamDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

